from fastapi import APIRouter
from app.api.v1.endpoints.auth import router as auth_router, user_router
from app.api.v1.endpoints.devices import router as devices_router
from app.api.v1.endpoints.work_orders import router as work_orders_router
from app.api.v1.endpoints.alerts import router as alerts_router
from app.api.v1.endpoints.dashboard import router as dashboard_router
from app.api.v1.endpoints.sensors import router as sensors_router

# 创建v1版本的主路由
api_router = APIRouter(prefix="/api/v1")

# 注册路由
api_router.include_router(auth_router)
api_router.include_router(user_router)
api_router.include_router(devices_router)
api_router.include_router(work_orders_router)
api_router.include_router(alerts_router)
api_router.include_router(dashboard_router)
api_router.include_router(sensors_router)

# 健康检查端点
@api_router.get("/health", tags=["健康检查"])
async def health_check():
    """健康检查"""
    return {
        "status": "healthy",
        "version": "1.0.0",
        "service": "美申智控系统API"
    }